package org.my_spring_mybatis.domain.service.impl;

import org.my_spring_mybatis.domain.Student;
import org.my_spring_mybatis.domain.dao.StudentDao;
import org.my_spring_mybatis.domain.service.StudentService;

import java.util.List;

/**
 * @author lihai
 * @Description
 * @create 2022/1/25 -23:20
 */
public class StudentsServiceImpl implements StudentService {
    private StudentDao dao;

    public StudentDao getDao() {
        return dao;
    }

    @Override
    public int addStudent(Student stu) {
        int num = dao.insertStudent(stu);
        return num;
    }

    @Override
    public List<Student> queryStudent() {
        List<Student> students = dao.selectStudent();
        return students;
    }
}
